package com.dbManage.entity;

/**
 * ----------------------------------
 * Describe:	Ecaj2.0
 * ----------------------------------
 * Author:	ONLINE.SANEN
 * Date:	2018/05/07
 * Time:	19:20:15
 * ----------------------------------
 */

public class Note {

    private int id;

    /**
     * 标题
     */
    private String title;

    /**
     * 帖子链接
     */
    private String url;

    /**
     * 语言类别:1.java 2.js/html/css 0.其他
     */
    private int lang;
    private String langStr;
    /**
     * 帖子类型:1.技术贴,2.问答帖,3.随笔,4.API文档
     */
    private int type;
    private String typeStr;
    /**
     * 关联项目 0.无
     */
    private int project;
    private String projectStr;
    /**
     * 添加时间戳
     */
    private int time;
    private String date;
    /**
     * 备注
     */
    private String ps;

    /**
     * 是否公开 0.公开  1.不公开
     */
    private int isPublic;

    /**
     * 访问数量
     */
    private int count;

    /**
     * 审核状态 0.待审核 1.审核通过 2.审核未通过
     */
    private int status;
    private String statusStr;
    /**
     * 添加者id
     */
    private int addId;

    /**
     * 添加者名字
     */
    private String addName;


    public void setId(int id) {
        this.id = id;
    }

    public int getId() {
        return id;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUrl() {
        return url;
    }

    /**
     * 语言类别:1.java 2.js/html/css 0.其他
     */
    /*public void setLang(int lang) {
        this.lang = lang;
        switch (lang) {
            case 0:
                this.langStr = "其他";
                break;
            case 1:
                this.langStr = "java";
                break;
            case 2:
                this.langStr = "js/html/css";
                break;

        }
    }*/

    public void setLang(int lang) {
        this.lang = lang;
        switch (lang) {
            case 0:
                this.langStr = "其他";
                break;
            case 1:
                this.langStr = "技术贴";
                break;
            case 2:
                this.langStr = "问答帖";
                break;
            case 3:
                this.langStr = "API文档";
                break;
            case 4:
                this.langStr = "IDE";
                break;
            case 5:
                this.langStr = "java";
                break;
            case 6:
                this.langStr = "js/html/css";
                break;
        }
    }


    public int getLang() {
        return lang;
    }

    /**
     * 帖子类型:1.技术贴,2.问答帖,3.随笔,4.API文档
     */
    public void setType(int type) {
        this.type = type;
        switch (type) {
            case 1:
                this.typeStr = "技术贴";
                break;
            case 2:
                this.typeStr = "问答帖";
                break;
            case 3:
                this.typeStr = "API文档";
                break;
            case 4:
                this.typeStr = "IDE";
                break;
            case 5:
                this.typeStr = "其他";
                break;
            default:
                this.typeStr = "其他";
        }
    }

    public int getType() {
        return type;
    }

    public void setProject(int project) {
        this.project = project;
        switch (project) {
            case 0:
                this.projectStr = "";
                break;
            case 1:
                this.projectStr = "小程序-标标有";
                break;
            case 2:
                this.projectStr = "小程序-标标有服务端";
                break;
        }
    }

    public int getProject() {
        return project;
    }

    public void setTime(int time) {
        this.time = time;
    }

    public int getTime() {
        return time;
    }

    public void setPs(String ps) {
        this.ps = ps;
    }

    public String getPs() {
        return ps;
    }

    public void setIsPublic(int isPublic) {
        this.isPublic = isPublic;
    }

    public int getIsPublic() {
        return isPublic;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public int getCount() {
        return count;
    }

    public void setStatus(int status) {
        this.status = status;
        switch(status){
            case 0:
                statusStr="待审核";
                break;
            case 1:
                statusStr="审核通过";
                break;
            case 2:
                statusStr="审核未通过";
                break;
        }
    }

    public String getStatusStr() {
        return statusStr;
    }

    public void setStatusStr(String statusStr) {
        this.statusStr = statusStr;
    }

    public int getStatus() {
        return status;
    }

    public void setAddId(int addId) {
        this.addId = addId;
    }

    public int getAddId() {
        return addId;
    }

    public void setAddName(String addName) {
        this.addName = addName;
    }

    public String getAddName() {
        return addName;
    }

    public String getLangStr() {
        return langStr;
    }

    public void setLangStr(String langStr) {
        this.langStr = langStr;
    }

    public String getTypeStr() {
        return typeStr;
    }

    public void setTypeStr(String typeStr) {
        this.typeStr = typeStr;
    }

    public String getProjectStr() {
        return projectStr;
    }

    public void setProjectStr(String projectStr) {
        this.projectStr = projectStr;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    @Override
    public String toString() {
        return "Note{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", url='" + url + '\'' +
                ", lang=" + lang +
                ", type=" + type +
                ", project=" + project +
                ", time=" + time +
                ", ps='" + ps + '\'' +
                ", isPublic=" + isPublic +
                ", count=" + count +
                ", status=" + status +
                ", addId=" + addId +
                ", addName='" + addName + '\'' +
                '}';
    }
}
